#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int* getRandom() {
  static int r[10];
  int i;
  srand((unsigned)time(NULL));
  for(i=0;i<10;i++) {
    r[i] = rand();
    printf("r[%d] = %d\n", i, r[i]);
  }
  return r;
}

int main () {
  int balance[] = {1, 10, 20};
  int len = sizeof(balance) / sizeof(int);
  printf("array length %d\n", len); 
  
  balance[1] = 100;
  for(int i = 0; i < len; i++) {
    printf("index: %d, value: %d\n", i, balance[i]);
  }

  int* firstPtr = balance;

  printf("first: %d\n", *firstPtr);

  firstPtr++;
  printf("firstPtr++: %d\n", *firstPtr);

  firstPtr++;
  printf("firstPtr++: %d\n", *firstPtr);

  int* randHeader = getRandom();
  printf("rand header: %d\n", *randHeader);
}